package com.kongmou.springDataJpaAdvanced.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

/**
 * @author Mocker
 * @Date 2016-12-10 下午4:52
 * @Description 用户
 * @Version 1.0
 */
@Entity(name = "User")
@Table(name = BaseEntity.TABLE_PREFIX + "USER")
public class User extends BaseEntity {


    //密码
    @Column(name = "password", length = 100, nullable = false)
    private String password;

    @Column(name = "nickname", length = 100, nullable = false)
    private String nickname;

    //用户名
    @Column(name = "name", length = 50, nullable = false, unique = true)
    private String name;

    //真实姓名
    @Column(name = "realname", length = 50, nullable = true)
    private String realname;

    //电话
    @Column(name = "phone", length = 11, nullable = true)
    private String phone;

    //身份证
    @Column(name = "card", length = 18, nullable = true)
    private String card;

    //用户状态
    //status是oracle关键词
    @Column(name = "state", nullable = false)
    private String status;

    //加盐
    @Column(name = "salt", nullable = false)
    private String salt;

    //关联用户的隐藏角色Id
    @Column(name = "hide_role_id", nullable = true)
    private String hideRoleId;

    //行政区域代码
    @Column(name = "region", nullable = false)
    private String region;

    //行政区域名称
    @Column(name = "region_name", nullable = false)
    private String regionName;

    //用户类型
    //user是普通用户 admin 是超级管理员
    @Column(name = "type", nullable = false)
    private String type;

    //创建时间
    @Column(name = "create_time", nullable = false)
    private Date createTime;

    //行政级别
    // @Column(name = "jb",nullable = false)
    @Transient
    private Integer jb;

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getRealname() {
        return realname;
    }

    public void setRealname(String realname) {
        this.realname = realname;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getCard() {
        return card;
    }

    public void setCard(String card) {
        this.card = card;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getHideRoleId() {
        return hideRoleId;
    }

    public void setHideRoleId(String hideRoleId) {
        this.hideRoleId = hideRoleId;
    }

    public String getRegion() {
        return region;
    }

    public void setRegion(String region) {
        this.region = region;
    }

    public String getRegionName() {
        return regionName;
    }

    public void setRegionName(String regionName) {
        this.regionName = regionName;
    }

    public Integer getJb() {
        return jb;
    }

    public void setJb(Integer jb) {
        this.jb = jb;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }
}


